package com.yantong.service;

import com.alibaba.fastjson.JSONObject;
import com.yantong.pojo.*;
import com.yantong.pojo.vo.StoreFreechargeVo;
import com.yantong.utils.PageUtils;

import java.util.List;

/**
 * 团购服务
 */
public interface ActivityService {

    /**
     * 后台查询所有活动
     * @param offset
     * @param limit
     * @param activityParam
     * @return
     */
    PageUtils<Activity> listAll(int offset, int limit, ActivityParam activityParam);


    List<ActivityProductSku> listActivityProductSkuByProductId(Long productCentreId);

    Long saveActivity(ActivityParam params);

    int updateActivity(ActivityParam params);

    Activity getActivityById(Long id);

    List<TicketUsableTeam> getTicketUsableTeam(Long id);

    Activity getActivityDetailById(Long id);

    List<ActivityProduct> selectByExample(ActivityProductExample example);

    List<ActivityProduct> listActivityProductsByActivityId(Long activityId, Integer type);

    List<ActivityProductSku> listActivityProductSkusByActivityId(Long activityId, Integer type);

    int removeActivity(Long id);

    int removeActivityProduct(Long id);

    List<StoreFreechargeVo> selectAllActivityProduct(Long activityId, Integer type);

    List<StoreFreechargeVo> selectAllActivityProductCoupon(Long activityId, Integer type);

    int addActivityProduct(ActivityProduct activityProduct);

    int editActivityProduct(ActivityProduct activityProduct);

    int addActivityProductSku(ActivityProductSku activityProductSku);

    int removeActivityProductSku(Long id);

    JSONObject getActivityDetail(Long memberId, Long activityId) throws IllegalAccessException;

    List<ActivityProduct> getBuyShops(Long mid);

    void deleteAndInsert(Long activityProductId, int type, Long[] ids);

    int updateActivity(Activity activity);

    PageUtils<Activity> selectActivityList(Long handselProductAuthorityId, int offset, int limit);

    PageUtils<Activity> selectActivityListByShopProductAuthorityId(Long shopProductAuthorityId, int offset, int limit);

    int changeStock(Integer total, Long activityId);
}

